package chapter03

/**
 * @program lu-scala01
 * @description: 特征叠加覆盖（后面的覆盖前面的）
 * @author: zhanglu
 * @create: 2022-03-27 18:49:00
 */
object C15_TraitOverlying {

  def main(args: Array[String]): Unit = {
    val student15 = new Student15
    student15.increase
  }

}

trait Knowledge15{
  var amount: Int = 0
  def increase {
    println("Knowledge15 increase")
  }
}

trait Talent15{
  def singing: Unit
  def dancing: Unit
  def increase {
    println("Talent15 increase")
  }
}

class Student15 extends Person13 with Knowledge15 with Talent15{
  override def singing: Unit = println("Student15 singing")

  override def dancing: Unit = println("Student15 dancing")

  override def increase: Unit = {
    super.increase
    //单独指定某个父类的方法
    super[Knowledge15].increase
    super[Talent15].increase
  }
}


